<div class="view_page">
<?php
$this->Review = cri('Review');
$fieldPropertyObject = $this->Review->getAttributes($reviewData);
$ratableFields = $fieldPropertyObject->getFields('type', SCHEMA_TYPE_RATING);
$allFields = $fieldPropertyObject->getFields();
$customFields = array_diff($allFields, $ratableFields);
?>

<h4><?php echo $reviewData['Review']['title']?></h4>
<b>
	<?php echo __("Posted By")?>
			
	<?php
	$profileUrl = '/admin/users/view/'.$reviewData['Review']['poster']['id'];
	if($reviewData['Review']['poster_entity'] == 'Guest')
	{
		$profileUrl = 'javascript::void();';
	} 
	echo $html->link($reviewData['Review']['poster']['display_name'],$profileUrl,array('class'=>'poster'));
	?>
	
	<?php echo $time->timeAgoInwords($reviewData['Review']['created'],array('shortString'=>true));?> <?php echo __("in")?>
	<?php echo $html->link($reviewData['Listing']['title'],'/admin/listings/view/'.$reviewData['Listing']['id']);?> </b><br/>
	<?php echo $reviewData['Review']['body'];?><br/>
<b>
<?php 
				//show overall rating if rateable fields are more than one.
				if(isset($reviewData['Review']['avg_score']) && count($ratableFields) > 1)
				{
					echo __("Overall rating");
					echo $rating->display(array('rating'=>$reviewData['Review']['avg_score'], 'tooltip' =>number_format($reviewData['Review']['avg_score'],1),'tooltipClass'=>'overall_'.$reviewData['Review']['id'].'_'.mt_rand(1,1000)));
				}?>
				<?php
				if(!empty($ratableFields))
				{
					foreach($ratableFields as $field)
					{
						echo $fieldPropertyObject->getPropertyValue($field,'label');
						if(isset($reviewData['Review'][$field]))
						{
							echo $rating->display(array('rating'=>$reviewData['Review'][$field], 'tooltip' =>number_format($reviewData['Review'][$field],1)));
						}
					}
				}else
				{
					echo $rating->display(array('rating'=>'0'));
				}
			?>
	</b>	
</div>